<?php
// ========================== 前台公共函数 ==========================//

define("_ROOT", "./");
// 加载公用函数
require_once(_ROOT. "include/common.inc.php");
require_once(_ROOT. "include/functions.inc.php");
// 根据伪静态状态返回相应的文章连接
function getarticleurl($feedid, $uid, $page = 1) {
	global $options;
	!$page && $page = 1;
	if ($options['rewrite_enable']) {
		$articleurl = 'articles-'.$feedid.'-'.$uid.'-'.$page.'.'.$options['rewrite_ext'];
	} else {
		$articleurl = './blog.php?action=show&id='.$feedid.'&uid='.$uid.'&page='.$page;
	}
	return $articleurl;
}
function bottom_title($action,$id){
	if($action=="next"){
		$sid = "feedid>'".$id."' ORDER BY feedid ASC";
	}else{
		$sid = "feedid<'".$id."' ORDER BY feedid DESC";
	}
    global $db,$tablepre;   
    	$title=$db->fetch_one_array("SELECT feed_title from {$tablepre}xna_feed WHERE state!='0' AND ".$sid." limit 1"); 
   		$title=($title['feed_title']==""?'没有了':$title['feed_title']);
    return $title;   
}
?>